import config from "@/config";
import { http } from "@/utils/request";

export default {
	version: {
		url: `${config.API_URL}/ver`,
		name: "获取最新版本号",
	},
	api: {
		list: {
			url: `${config.API_URL}/system/api/list`,
			name: "接口列表",
		},
		delete: {
			url: `${config.API_URL}/system/api/delete`,
			name: "删除接口",
		},
		save: {
			url: `${config.API_URL}/system/api/save`,
			name: "编辑保存接口",
		},
	},
	config: {
		setConfig: {
			url: `${config.API_URL}/system/config/setConfig`,
			name: "接口列表",
		},
		getConfig: {
			url: `${config.API_URL}/system/config/getConfig`,
			name: "接口列表",
		},

	},
	token: {
		list: {
			url: `${config.API_URL}/system/token/list`,
			name: "接口列表",
		},
	},
	InstorageWay: {
		list: {
			url: `${config.API_URL}/system/InstorageWay/list`,
			name: "接口列表",
		},
		delete: {
			url: `${config.API_URL}/system/InstorageWay/delete`,
			name: "删除接口",
		},
		save: {
			url: `${config.API_URL}/system/InstorageWay/save`,
			name: "编辑保存接口",
		},
	},
	subscribe: {
		listApi: {
			url: `${config.API_URL}/system/subscribe/listApi`,
			name: "接口列表",
		},
		subscribe: {
			url: `${config.API_URL}/system/subscribe/subscribe`,
			name: "订阅",
		},
		nosubscribe: {
			url: `${config.API_URL}/system/subscribe/nosubscribe`,
			name: "取消订阅",
		},
		list: {
			url: `${config.API_URL}/system/subscribe/list`,
			name: "接口列表",
		},
		delete: {
			url: `${config.API_URL}/system/subscribe/delete`,
			name: "删除订阅接口",
		},
		save: {
			url: `${config.API_URL}/system/subscribe/save`,
			name: "编辑保存订阅接口",
		},
	},

	menu: {
		myMenus: {
			url: `${config.API_URL}/system/menu/userMenu`,
			name: "获取我的菜单",
		},
		list: {
			url: `${config.API_URL}/system/menu/list`,
			name: "获取菜单",
		},
		role: {
			url: `${config.API_URL}/system/menu/role`,
			name: "根据角色得到菜单Id值",
		},
		delete: {
			url: `${config.API_URL}/system/menu/delete`,
			name: "获取菜单",
		},
		save: {
			url: `${config.API_URL}/system/menu/save`,
			name: "保存菜单",
		},
		saveSort: {
			url: `${config.API_URL}/system/menu/saveSort`,
			name: "保存菜单排序",
		},
	},
	financeDepartment: {
		treelist: {
			url: `${config.API_URL}/system/financeDepartment/treelist`,
			name: "获取部门",
		},
		list: {
			url: `${config.API_URL}/system/financeDepartment/list`,
			name: "获取部门",
		},
		delete: {
			url: `${config.API_URL}/system/financeDepartment/delete`,
			name: "删除部门",
		},
		save: {
			url: `${config.API_URL}/system/financeDepartment/save`,
			name: "保存部门",
		},
	},
	department: {
		treelist: {
			url: `${config.API_URL}/system/department/treelist`,
			name: "获取部门",
		},
		list: {
			url: `${config.API_URL}/system/department/list`,
			name: "获取部门",
		},
		delete: {
			url: `${config.API_URL}/system/department/delete`,
			name: "删除部门",
		},
		save: {
			url: `${config.API_URL}/system/department/save`,
			name: "保存部门",
		},
	},
	dic: {
		getCategory: {
			url: `${config.API_URL}/system/dic/getCategory`,
			name: "获取字典树",
		},
		saveCategory: {
			url: `${config.API_URL}/system/dic/saveCategory`,
			name: "字典明细",
		},
		deleteCategory: {
			url: `${config.API_URL}/system/dic/deleteCategory`,
			name: "删除字典组",
		},
		list: {
			url: `${config.API_URL}/system/dic/list`,
			name: "字典明细",
		},
		sort: {
			url: `${config.API_URL}/system/dic/sort`,
			name: "字典数据排序",
		},
		get: {
			url: `${config.API_URL}/system/dic/get`,
			name: "获取字典数据",
			get: async function (params) {
				return await http.get(this.url, { filter: [params] });
			},
		},
		getDicData: {
			url: `${config.API_URL}/system/dic/getDicData`,
			name: "获取字典数据明细",
			config: {
				cache: true,
			},
		},
		save: {
			url: `${config.API_URL}/system/dic/save`,
			name: "获取字典数据",
		},
		delete: {
			url: `${config.API_URL}/system/dic/delete`,
			name: "获取字典数据",
		},
		enable: {
			url: `${config.API_URL}/system/dic/enable`,
			name: "启用",
		},
	},
	role: {
		list: {
			url: `${config.API_URL}/system/role/list`,
			name: "获取角色列表",
		},
		save: {
			url: `${config.API_URL}/system/role/save`,
			name: "保存角色",
		},
		delete: {
			url: `${config.API_URL}/system/role/delete`,
			name: "删除角色列表",
		},
		menu: {
			url: `${config.API_URL}/system/role/menu`,
			name: "获取角色授权的菜单",
		},
		department: {
			url: `${config.API_URL}/system/role/department`,
			name: "获取角色授权的菜单",
		},
		savePermission: {
			url: `${config.API_URL}/system/role/savePermission`,
			name: "获取角色授权的菜单",
		},
		column: {
			url: `${config.API_URL}/system/role/column`,
			name: "获取要授权的列",
		},
		api: {
			url: `${config.API_URL}/system/role/api`,
			name: "获取要授权的列",
		},
		table_right_btn: {
			url: `${config.API_URL}/system/role/table_right_btn`,
			name: "编辑保存接口",
		},
		tablelist: {
			url: `${config.API_URL}/system/role/tablelist`,
			name: "编辑保存接口",
		},
		savetable: {
			url: `${config.API_URL}/system/role/savetable`,
			name: "编辑保存接口",
		},
		saveroletable: {
			url: `${config.API_URL}/system/role/saveroletable`,
			name: "编辑保存接口",
		},
		enableApi: {
			url: `${config.API_URL}/system/role/enableApi`,
			name: "获取要授权的列",
		},
		disableApi: {
			url: `${config.API_URL}/system/role/disableApi`,
			name: "获取要授权的列",
		},
	},
	dept: {
		list: {
			url: `${config.API_URL}/system/dept/list`,
			name: "获取部门列表",
		},
	},
	user: {
		userTokenList: {
			url: `${config.API_URL}/system/user/userTokenList`,
			name: "获取用户列表",
		},
		userTokenDelete: {
			url: `${config.API_URL}/system/user/userTokenDelete`,
			name: "获取用户列表",
		},
		list: {
			url: `${config.API_URL}/system/user/list`,
			name: "获取用户列表",
		},
		reSetPassWord: {
			url: `${config.API_URL}/system/user/reSetPassWord`,
			name: "重置密码",
		},
		save: {
			url: `${config.API_URL}/system/user/save`,
			name: "保存用户",
		},
		delete: {
			url: `${config.API_URL}/system/user/delete `,
			name: "删除用户",
		},
	},
	app: {
		list: {
			url: `${config.API_URL}/system/app/list`,
			name: "应用列表",
		},
	},
	log: {
		list: {
			url: `${config.API_URL}/system/log/list`,
			name: "日志列表",
		},
	},
	mpcLocaltion: {
		list: {
			url: `${config.API_URL}/system/mpcLocation/list`,
			name: "日志列表",
		},
		treelist: {
			url: `${config.API_URL}/system/mpcLocation/treelist`,
			name: "日志列表",
		},
		save: {
			url: `${config.API_URL}/system/mpcLocation/save`,
			name: "日志列表",
		},
		delete: {
			url: `${config.API_URL}/system/mpcLocation/delete `,
			name: "日志列表",
		},
		defaultLocation: {
			url: `${config.API_URL}/system/mpcLocation/defaultLocation `,
			name: "默认库存位置",
		},
	},
	autocode: {
		list: {
			url: `${config.API_URL}/system/autoCode/list`,
			name: "日志列表",
		},
		save: {
			url: `${config.API_URL}/system/autoCode/save`,
			name: "日志列表",
		},
		delete: {
			url: `${config.API_URL}/system/autoCode/delete `,
			name: "日志列表",
		},
	},
	table: {
		list: {
			url: `${config.API_URL}/system/table/list`,
			name: "表格列管理列表",
		},
		info: {
			url: `${config.API_URL}/system/table/info`,
			name: "表格列管理详情",
			config: {
				cache: true,
			},
		},
		infoNoCache: {
			url: `${config.API_URL}/system/table/info`,
			name: "表格列管理详情",
		},
		save: {
			url: `${config.API_URL}/system/table/save`,
			name: "表格列管理详情",
		},
		delete: {
			url: `${config.API_URL}/system/table/delete `,
			name: "表格列管理详情",
		},
	},
	tableReport: {
		info: {
			url: `${config.API_URL}/system/tableReport/info`,
			name: "表格列管理详情",
		},
		save: {
			url: `${config.API_URL}/system/tableReport/save`,
			name: "表格列管理详情",
		},
		list: {
			url: `${config.API_URL}/system/tableReport/list`,
			name: "表格列管理详情",
		},
	},
	barcode: {
		info: {
			url: `${config.API_URL}/system/barcode/info`,
			name: "表格列管理详情",
		},
		save: {
			url: `${config.API_URL}/system/barcode/save`,
			name: "表格列管理详情",
		},
		list: {
			url: `${config.API_URL}/system/barcode/list`,
			name: "表格列管理详情",
		},
	},
	tableconfig: {
		category: {
			url: `${config.API_URL}/system/table/category`,
			name: "表格列管理组",
		},
		list: {
			url: `${config.API_URL}/system/table/list`,
			name: "表格列管理列表",
		},
		info: {
			url: `${config.API_URL}/system/table/info`,
			name: "表格列管理详情",
		},
		save: {
			url: `${config.API_URL}/system/table/save`,
			name: "表格列管理详情",
		},
		delete: {
			url: `${config.API_URL}/system/table/delete `,
			name: "表格列管理详情",
		},
		authColumn: {
			url: `${config.API_URL}/system/table/authColumn`,
			name: "获取要授权的列",
		},
	},
	tasks: {
		list: {
			url: `${config.API_URL}/system/tasks/list`,
			name: "系统任务管理",
		},
	},
	attachment: {
		upload: {
			url: `${config.API_URL}/system/attachment/upload`,
			name: "系统任务管理",
			customerPost: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			},
		},
		list: {
			url: `${config.API_URL}/system/attachment/list`,
			name: "系统任务管理",
		},
	},
};
